import request from "@/utils/request";

/**
 * 客户流失列表
 * @param { CustomLoseList } params
 */
export const listLose = params => {
  return request({
    url: "/crm/info/listLoss",
    method: "get",
    params
  });
};

/**
 * 取消流失
 * @param {string} customerId
 */
export const cancelLoss = customerId => {
  return request({
    url: `/crm/info/cancelLoss/${customerId}`,
    method: "put"
  });
};

/**
 * 流失审批详情
 */
export const lossApprovalDetail = processDefId => {
  return request({
    url: `/process/instance/progress/${processDefId}`,
    method: "get"
  });
};

/**
 * 客户基本信息 + 跟进记录
 * @param { string } customerId
 */
export const clientInfoAndFollow = customerId => {
  return request({
    url: `/crm/info/getInfoPenetration/${customerId}`,
    method: "get"
  });
};

/**
 * 服务团队
 * @param { string } customerId
 * @returns { Array<ServiceTeamData> }
 */
export const getServiceTeam = customerId => {
  return request({
    url: `/crm/info/getServiceTeam/${customerId}`,
    method: "get"
  });
};

/**
 * 客户阶段列表
 * @param { string } customerId -客户ID
 * @returns { Array<ClientStageData> }
 */
export const getStageList = customerId => {
  return request({
    url: `/crm/info/stage/list/${customerId}`,
    method: "get"
  });
};

/**
 * 客户阶段内容视图
 * @param { string } customerId -客户ID
 */
export const getStageView = customerId => {
  return request({
    url: `/crm/info/stage/content/${customerId}`,
    method: "get"
  });
};
